﻿import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Controls 1.2
import QtQuick.Window 2.2
import QtQuick.Controls.Styles 1.4
Rectangle{

    QtObject{
            id: info;
            property int  infonum;
            Component.onCompleted: {
                info.infonum = 2;
            }
        }

    width: 1280
    height: 800
    color:"cadetblue";


    Rectangle{
    id:alertif;
    x:40;
    y:100;
    width: 100;
    height: 30;
    color: "cadetblue";
    border.color: "black"
    Text {
        text: "报警信息"
        anchors.centerIn: parent;
        color: "yellow"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    }
    Rectangle{

    id:middle;
    x:40;
    y:alertif.y+alertif.height;
    width: 800;
    height: 500;
    color: transparent
    border.color: "red"

    TableView
    {
        id: tableView
        anchors.fill: parent
        model: theWarningModel
        TableViewColumn
        {
            id: checkedColumn
            width:60
            role: "bianhao"
            title: qsTr( "编号" )

        }
        TableViewColumn
        {width:60
            role: "zhuangtai"
            title: qsTr( "状态" )
        }
        TableViewColumn
        {width:100
            role: "baojingshijian"
            title: qsTr( "报警时间" )
        }

        TableViewColumn
        {width:140
            role: "querenhuifushijian"
            title: qsTr( "确认恢复时间" )
        }
        TableViewColumn
        {
            width:60
            role: "mingcheng"
            title: qsTr( "名称" )
        }
        TableViewColumn
        {width:60
            role: "xingxi"
            title: qsTr( "信息" )
        }
        TableViewColumn
        {width:80
            role: "baojingzhi"
            title: qsTr( "报警值" )
        }
        TableViewColumn
        {
            role: "beizhu"
            title: qsTr( "备注" )
        }

}
}
    Rectangle{
    id:right;
    x:middle.x+middle.width+60;
    y:middle.y;
    width:350;
    height: 500;
    color: "cadetblue";
    border.color: "black"
    Rectangle{
    id:rightup;
    width: right.width;
    height: 40;
    color: right.color
    border.color: "black"
    Text {
        text: "设备状态"
        anchors.centerIn: parent;
        color: "yellow"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }

    }

    Rectangle{
    id:rightmid;
    anchors.top: rightup.bottom;
    width: right.width;
    height: 230;
    color: right.color
    border.color: "black"
    Text {
        x:50;
        y:10;
        text: "#1号锅炉"
        color: "yellow"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }

    Rectangle{
    x:50;
    y:30;
    width: 100;
    height: 20;
    color:right.color;
    border.color: "white"
    Text {
        text: "探头状态"
        anchors.centerIn: parent;
        color: "white"
        font.family: "Ubuntu"
        font.pixelSize: 15
    }
    }

    Rectangle{
    x:200;
    y:30;
    width: 100;
    height: 20;
    color:"green";
    border.color: "white"
    Text {
        text: "正常"
        anchors.centerIn: parent;
        color: "black"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    }

    Rectangle{
    x:50;
    y:60;
    width: 100;
    height: 20;
    color:right.color;
    border.color: "white"
    Text {
        text: "采样管线状态"
        anchors.centerIn: parent;
        color: "white"
        font.family: "Ubuntu"
        font.pixelSize: 15
    }
    }

    Rectangle{
    x:200;
    y:60;
    width: 100;
    height: 20;
    color:"green";
    border.color: "white"
    Text {
        text: "正常"
        anchors.centerIn: parent;
        color: "black"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    }
    Rectangle{
    x:50;
    y:90;
    width: 100;
    height: 20;
    color:right.color;
    border.color: "white"
    Text {
        text: "采样流量状态"
        anchors.centerIn: parent;
        color: "white"
        font.family: "Ubuntu"
        font.pixelSize: 15
    }
    }

    Rectangle{
    x:200;
    y:90;
    width: 100;
    height: 20;
    color:"green";
    border.color: "white"
    Text {
        text: "正常"
        anchors.centerIn: parent;
        color: "black"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    }
    Rectangle{
    x:50;
    y:120;
    width: 100;
    height: 20;
    color:right.color;
    border.color: "white"
    Text {
        text: "制冷器状态"
        anchors.centerIn: parent;
        color: "white"
        font.family: "Ubuntu"
        font.pixelSize: 15
    }
    }

    Rectangle{
    x:200;
    y:120;
    width: 100;
    height: 20;
    color:"green";
    border.color: "white"
    Text {
        text: "正常"
        anchors.centerIn: parent;
        color: "black"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    }

    Rectangle{
    x:50;
    y:150;
    width: 100;
    height: 20;
    color:right.color;
    border.color: "white"
    Text {
        text: "分析仪状态"
        anchors.centerIn: parent;
        color: "white"
        font.family: "Ubuntu"
        font.pixelSize: 15
    }
    }

    Rectangle{
    x:200;
    y:150;
    width: 100;
    height: 20;
    color:"green";
    border.color: "white"
    Text {
        text: "正常"
        anchors.centerIn: parent;
        color: "black"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    }



    }


    Rectangle{
    id:rightdown;
    anchors.top: rightmid.bottom;
    width: right.width;
    height: 230;
    color: right.color
    border.color: "black"
    Text {
        x:50;
        y:10;
        text: "#2号锅炉"
        color: "yellow"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    Rectangle{
    x:50;
    y:30;
    width: 100;
    height: 20;
    color:right.color;
    border.color: "white"
    Text {
        text: "探头状态"
        anchors.centerIn: parent;
        color: "white"
        font.family: "Ubuntu"
        font.pixelSize: 15
    }
    }

    Rectangle{
    x:200;
    y:30;
    width: 100;
    height: 20;
    color:"green";
    border.color: "white"
    Text {
        text: "正常"
        anchors.centerIn: parent;
        color: "black"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    }

    Rectangle{
    x:50;
    y:60;
    width: 100;
    height: 20;
    color:right.color;
    border.color: "white"
    Text {
        text: "采样管线状态"
        anchors.centerIn: parent;
        color: "white"
        font.family: "Ubuntu"
        font.pixelSize: 15
    }
    }

    Rectangle{
    x:200;
    y:60;
    width: 100;
    height: 20;
    color:"green";
    border.color: "white"
    Text {
        text: "正常"
        anchors.centerIn: parent;
        color: "black"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    }
    Rectangle{
    x:50;
    y:90;
    width: 100;
    height: 20;
    color:right.color;
    border.color: "white"
    Text {
        text: "采样流量状态"
        anchors.centerIn: parent;
        color: "white"
        font.family: "Ubuntu"
        font.pixelSize: 15
    }
    }

    Rectangle{
    x:200;
    y:90;
    width: 100;
    height: 20;
    color:"green";
    border.color: "white"
    Text {
        text: "正常"
        anchors.centerIn: parent;
        color: "black"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    }
    Rectangle{
    x:50;
    y:120;
    width: 100;
    height: 20;
    color:right.color;
    border.color: "white"
    Text {
        text: "制冷器状态"
        anchors.centerIn: parent;
        color: "white"
        font.family: "Ubuntu"
        font.pixelSize: 15
    }
    }

    Rectangle{
    x:200;
    y:120;
    width: 100;
    height: 20;
    color:"green";
    border.color: "white"
    Text {
        text: "正常"
        anchors.centerIn: parent;
        color: "black"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    }

    Rectangle{
    x:50;
    y:150;
    width: 100;
    height: 20;
    color:right.color;
    border.color: "white"
    Text {
        text: "分析仪状态"
        anchors.centerIn: parent;
        color: "white"
        font.family: "Ubuntu"
        font.pixelSize: 15
    }
    }

    Rectangle{
    x:200;
    y:150;
    width: 100;
    height: 20;
    color:"green";
    border.color: "white"
    Text {
        text: "正常"
        anchors.centerIn: parent;
        color: "black"
        font.family: "Ubuntu"
        font.pixelSize: 20
    }
    }

    }


    }
    Rectangle{
    x:600;
    y:700;
        width: 30;
        height: 20;
        color:"gray";

        Button{
            text:"查询当前报警信息";
            anchors.centerIn: parent;

            onClicked: {
               // myPopup.open();
                theWarningModel.update();
            }
        }

    }

}
